import App from './App'
import commonHeader from '@/components/common_header.vue'
import uviewPlus from '@/uni_modules/uview-plus'
import store from '@/store/index.js'
import i18n from './lang/index.js'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
Vue.prototype.$store = store
App.mpType = 'app'
Vue.component('commonHeader', commonHeader)

const app = new Vue({
	i18n,
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'

export function createApp() {
	const app = createSSRApp(App)
	app.component('commonHeader', commonHeader)
	// main.js，注意要在use方法之后执行
	app.use(uviewPlus)
	app.use(store)
	app.use(i18n)
	// app.use(i18n)
	// 如此配置即可
	uni.$u.config.unit = 'rpx'
	return {
		app
	}
}
// #endif